from pptx import Presentation

# 创建ppt对象
ppt = Presentation()
# 选择布局
layout = ppt.slide_layouts[0]
# 添加幻灯片
slide = ppt.slides.add_slide(layout)
# 获得本幻灯片中所有的占位符
placeholders = slide.shapes.placeholders
placeholders[0].text = '第一个文本框'
placeholders[1].text = '第二个文本框'
ppt.save('write_text2.pptx')